<template>
	<view>
		<web-view v-if="wxUrl" :src="wxUrl"></web-view>
		<template v-else>
			<navbar title="公告" />
			<view class="content">
				<up-parse :content="content"></up-parse>
			</view>
		</template>
	</view>
</template>

<script setup>
	import navbar from "@/components/navbar.vue"
	import noticeApi from "@/sheep/api/system/notice.js"
	import {
		onLoad,
	} from '@dcloudio/uni-app';
	import {
		ref
	} from "vue"

	const content = ref("")
	const wxUrl = ref(null);

	onLoad((e) => {
		noticeApi.get(e.id).then(res => {
			if (res.code === 0) {
				content.value = res.data.content
				wxUrl.value = res.data?.wxUrl || null;
				console.log(content.value)
			}
		})
	})
</script>

<style>
	page {
		background: #F8F3E9;
	}
</style>
<style scoped lang="scss">
	.content {
		padding: 30rpx;
	}
</style>